const state = {
    userData:[],//用户数据
    grade:''//权限
};

const mutations = {
    // 创建账号
    registerAccount(state, payload){
        state.userData.push(payload)
    },

    // 登陆账号
    loginAccount(state){
        state.grade=1
    },

    // 游客登陆账号
    withoutLogin(state){
      state.grade=0
  },
};

const getters = {
  // 获取用户数据
  userDataGetter(state) {
    return state.userData
  },
  
  // 获取用户权限
  grade(state){
    return state.grade
  }
};

export default {
  state,
  getters,
  mutations
};
